<template>
  <el-menu-item
    :index="basePath === '/' ? `/${route.path}` : `${basePath}/${route.path}`"
  >
    <i :class="route.meta.icon ? route.meta.icon : ''"></i>
    <template #title>{{ route.meta.title }}</template>
  </el-menu-item>
</template>

<script>
import { defineComponent } from "vue";
import { RouteRecordRaw } from "vue-router";
export default {
  name: "menuItem",
  props: {
    routes: {
      type: Object,
      required: true,
    },
    basePath: {
      type: String,
      required: true,
    },
  },
  setup(props) {
    const route = props.routes;
    return {
      route,
    };
  },
};
</script>

<style></style>
